package com.culture.config.common.model;

/**
 * BusinessException
 * @author enjoy
 * @version 1.0
 */ 
public class BusinessException extends RuntimeException{	
	/**
	 * BusinessException serialVersionUID
	 */
	private static final long serialVersionUID = 4151749052200407717L; 
	private String businessExceptionCode = "999999";
	private String businessExceptionMessage = "system exception";

	public BusinessException() {
        super();
    }
	
	public BusinessException(String message) {
		super(message);
		this.businessExceptionMessage = message;
	}
	
	public BusinessException(String message,String code) {
		super(message);
		this.businessExceptionMessage = message;
		this.businessExceptionCode = code;
	}
	
    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.businessExceptionMessage = message;
    }
    
    public BusinessException(Throwable cause) {
        super(cause);
    }
    
    public BusinessException(String message, Throwable cause,
            boolean enableSuppression,
            boolean writableStackTrace) {
    	super(message, cause, enableSuppression, writableStackTrace);
    	this.businessExceptionMessage = message;
    }
    
    public String getBusinessExceptionCode() {
    	return this.businessExceptionCode;
    }
    
    public String getBusinessExceptionMessage() {
    	return this.businessExceptionMessage;
    }
    
    /**
     * throwException
     * @param message
     * @throws BusinessException
     */
    public static void throwException(String message) throws BusinessException{    	
		throw new BusinessException(message);
	}
	
}
